package com.sutuijingling.a;

import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.sutuijingling.bean.AccountBean;
import com.sutuijingling.utils.c;
import java.io.File;
import org.apache.http.HttpStatus;

public class k extends e {
    static String h = "running";
    static String i = "finish";
    static File j = new File("/data/local/tmp/input_param.txt");
    String a = "";
    String b = "";
    String c = "";
    String d = "";
    String e = "";
    long f = 0;
    String g = "";
    private UiObject k;

    public k(UiDevice uiDevice, long j, AccountBean accountBean, String str) {
        super(uiDevice);
        this.a = accountBean.getRealname();
        this.b = accountBean.getRealPswd();
        this.c = accountBean.getRealPaycode();
        this.e = "516188";
        this.d = "linzhenzhen8";
        this.g = str;
        this.f = j;
    }

    public void a() throws UiObjectNotFoundException {
        doOpenMainHome();
    }

    public void b() throws UiObjectNotFoundException {
        c.d();
        UiObject findByResId = findByResId("org.zirco:id/ChangelogActivity.CloseBtn", 1);
        if (findByResId.exists()) {
            c.c(findByResId);
            c.d();
        }
        c.c(findByResId("org.zirco:id/loadAlipay", 2));
        d();
        c();
    }

    public void c() throws UiObjectNotFoundException {
        this.k = findByResId("org.zirco:id/statusText", 2);
        c.c(findByResId("org.zirco:id/r3", 2));
        c.e();
    }

    public void d() throws UiObjectNotFoundException {
        int i = 0;
        while (i < HttpStatus.SC_MULTIPLE_CHOICES) {
            String text = this.k.getText();
            if (i.equals(text)) {
                b.a();
                b.c();
                return;
            } else if (h.equals(text)) {
                c.d();
                i++;
            } else {
                c.d();
                i++;
            }
        }
    }
}
